Technology Tales

Adventures & experiences in contemporary technology

Moving application title bar buttons on GNOME desktops

6th March 2010

Screenshot-Configuration Editor

A recent look at how Ubuntu 10.04 development is getting on confronted me with an interface situation to which I am not accustomed: title bar buttons at the left. The usual combination of buttons for maximisation, minimisation and closure were there in their usual order but at the left of the window. While this is the where you find them on OS X, I prefer the Windows convention and placed them to the right again.

To achieve that end, I ran gconf-editor from the command line using my usual user account (not sudo; that doesn’t seem to work) and made my way to apps -> metacity -> general. Once there, I sought out the button_layout property and moved the colon in the value from the left to the right. In other words, I started with this:

maximize,minimize,close:

and changed it to this (note the position of the colon in the actual string):

:maximize,minimize,close

If you ever find yourself wanting to change things from the Windows convention to the Apple one, just reverse what I did. As an aside, you also can swap the button order too if you like. After all, it’s just a text field that you can edit and the screen immediately refreshes when you hit the Return key after completing the edit.

As a more general observation, if Ubuntu 10.04 does come out using the OS X convention for title bar button placement, I could see others like wanting it changed back and that’s why I am sharing it here. Surprising users in this way, especially after the 9.10 release’s attracting some adverse comments, would not be all that advisable. The issue may be easy to address, but that’s small comfort when you release how easily users are discouraged.

Nevertheless, 10.04 is an LTS release and what I have seen so far looks polished; there may be no splash screen at boot and shutdown time for what I am running (I am sticking with acquiring upgrades every so often instead of periodic re-installation from a new disk image) but that’s a minor matter.

For the sake of not turning over the apple cart, I may have left off VirtualBox Additions and things look steady enough so far. In fact, I am writing these words using Firefox 3.6 on there. Accompanying that is OpenOffice 3.2, but things do not look so different apart from these, a reassuring observation. While there may be an emphasis on purple in the colour scheme at the time of writing, that could change yet. 9.10’s course had plenty of that so I am willing to be patient. After all, there’s more than a month to go, yet before the final cut is available for general use.

The wonders of mod_rewrite

24th June 2007

When I wrote about tidying dynamic URL’s a little while back, I had no inkling that that would be a second part to the tale. My discovery of mod_rewrite, an Apache module that facilitates URL translation. The effect is that one URL is presented to the user in the browser address bar, and the exact same URL is also seen by search engines, while another is passed to the server for processing. It might sound like subterfuge but it works very well once you manage to get it set up properly. The web host for my hillwalking blog/photo gallery has everything configured such it is ready to go but the same did not apply to the offline Apache 2.2.x server that I have going on my own Windows XP box. There were two parts to getting it working there:

  1. Activating mod-rewrite on the server: this is as easy as uncommenting a line in the httpd.conf file for the site (the line in question is: LoadModule rewrite_module modules/mod_rewrite.so).
  2. Ensuring that the .htaccess file in the root of the web server directory is active. You need to set the values of the AllowOverride directives for the server root and CGI directories to All so that .htaccess is active. Not doing it for the latter will result in the an error beginning with the following: Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden. Having Allow from All set for the required directories is another option to consider when you see errors like that.

Once you have got the above sorted, adding this line to .htaccess: RewriteEngine On. Preceding it with an Options directive to ensure that FollowSymLinks and SymLinksIfOwnerMatch are switched on does no harm at all and may even be needed to get things running. That done, you can set about putting mod_write to work with lines like this:

RewriteRule ^pages/(.*)/?$ pages.php?query=$1

The effect of this is to take http://www.website.com/pages/input and convert it into a form for action by the server; in this case, that is http://www.website.com/pages.php?query=input. Anything contained by a bracket is assigned to the value of a system-named variable. If you have several bracketed sections, they are assigned to sequentially numbered variables as follows: $1 for the first, $2 for the second and so on. It’s all good stuff when you get it going and not only does it make things look much neater but it also possesses an advantage when it comes to future-proofing too. Web addresses can be kept constant over time, even if things change behind the scenes. It means that returning visitors will find what they saw the last time that they visited and surely must ensure good karma in eyes of those all important search engines.

Adding a new domain or subdomain to an SSL certificate using Certbot

11th June 2019

On checking the Site Health page of a WordPress blog, I saw errors that pointed to a problem with its SSL set up. The www subdomain was not included in the site’s certificate and was causing PHP errors as a result though they had no major effect on what visitors saw. Still, it was best to get rid of them so I needed to update the certificate as needed. Execution of a command like the following did the job:

sudo certbot --expand -d existing.com,www.example.com

Using a Let’s Encrypt certificate meant that I could use the certbot command since that already was installed on the server. The --expand and -d switches ensured that the listed domains were added to the certificate to sort out the observed problem. In the above, a dummy domain name is used but this was replaced by the real one to produce the desired effect and make things as they should have been.

Using .htaccess to control hotlinking

10th October 2020

There are times when blogs cease to exist and the only place to find the content is on the Wayback Machine. Even then, it is in danger of being lost completely. One such example is the subject of this post.

Though this website makes use of the facilities of Cloudflare for various functions that include the blocking of image hotlinking, the same outcome can be achieved using .htaccess files on Apache web servers. It may work on Nginx to a point too but there are other configuration files that ought to be updated instead of using a .htaccess when some frown upon the approach. In any case, the lines that need adding to .htaccess are listed below though the web address needs to include your own domain in place of the dummy example provided:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpe?g|png|bmp)$ [F,NC]

The first line turns on the mod_rewrite engine and you may have that done anyway. Of course, the module needs enabling in your Apache configuration for this to work and you have to be allowed to perform the required action as well. This means changing the Apache configuration files. The next pair of lines look at the HTTP referer strings and the third one only allows images to be served from your own web domain and not others. To add more, you need to copy the third line and change the web address accordingly. Any new lines need to precede the last line that defines the file extensions that are to be blocked to other web addresses.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
RewriteRule \.(gif|jpe?g|png|bmp)$ /images/image.gif [L,NC]

Another variant of the previous code involves changing the last line to display a default image showing others what is happening. That may not reduce the bandwidth usage as much as complete blocking but it may be useful for telling others what is happening.

Getting Eclipse to start without incompatibility errors on Linux Mint 19.1

12th June 2019

Recent curiosity about Java programming and Groovy scripting got me trying to start up the Eclipse IDE that I had install on my main machine. What I got instead of a successful application startup was a message that included the following:

!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:626)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

The cause was a mismatch between Eclipse and the installed version of Java that it needed in order to run. After all, the software itself is written in the Java language and the installed version from the usual software repositories was too old for Java 11. The solution turned out to be installing a newer version as a Snap (Ubuntu’s answer to Flatpak). The following command did the needful since Snapd already was running on my machine:

sudo snap install eclipse --classic

The only part of the command that warrants extra comment is the --classic switch since that is needed for a tool like Eclipse that needs to access a host file system. On executing, the software was downloaded from Snapcraft and then installed within its own bundle of dependencies. The latter adds a certain detachment from the underlying Linux installation and ensures that no messages appear because of incompatibilities like the one near the start of this post.

Adding a Start Menu to Windows 8

16th October 2012

For all the world, it looks like Microsoft has mined a concept from a not often recalled series of Windows: 3.x. Then, we had a Program Manager for starting all our applications with no sign of a Start Menu. That came with Windows 95 and I cannot anyone mourning the burying of the Program Manager interface either. It was there in Windows 95 if you knew where to look and I do remember starting an instance, possibly out of curiosity.

Every Windows user seems to have taken to the Start Menu regardless of how big they grow when you install a lot of software on your machine. It didn’t matter that Windows NT got it later than Windows 9x ones either; NT 3.51 has the Program Manager too and it was NT 4 that got the then new interface that has been developed and progressed in no less than four subsequent versions of Windows (2000, XP, Vista & 7). Maybe it was because computing was the preserve of fewer folk that the interchange brought little if any sign of a backlash. The zeitgeist of the age reflected the newness of desktop computing and its freshness probably brought an extra level of openness too.

Things are different now, though. You only have to hear of the complaints about changes to Linux desktop environments to realise how attached folk become to certain computer interfaces. Ironically, personal computing has just got exciting again after a fairly stale decade of stasis. Mobile computing devices are aplenty and it no longer is a matter of using a stationary desktop PC or laptop and those brought their own excitement in the 1990’s. In fact, reading a title like Computer Shopper reminds me of how things once were with its still sticking with PC reviews while others are not concentrating on them as much. Of course, the other gadgets get reviewed too so it is not stuck in any rut. Still, it is good to see the desktop PC getting a look in in an age when there is so much competition, especially from phones and tablets.

In this maelstrom, Microsoft has decided to do something dramatic with Windows 8. It has resurrected the Program Manager paradigm in the form of the Start screen and excised the Start Menu from the desktop altogether. For touch screen computing interfaces such as tablets, you can see the sense of this but it’s going to come as a major surprise to many. Removing what lies behind how many people interact with a PC is risky and you have to wonder how it’s going to work out for all concerned.

What reminded me of this was a piece on CNET by Mary Jo Foley. Interestingly, software is turning up that returns the Start Menu (or Button) to Windows 8. One of these is Classic Shell and I decided to give it a go on a Windows 8 Enterprise evaluation instance that I have. Installation is like any Windows program and I limited the options to the menu and updater. At the end of the operation, a button with a shell icon appeared on the desktop’s taskbar. You can make the resultant menu appear like that of Windows XP or Windows 7 if you want. There are other settings like what the Windows key does and what happens when you click on the button with a mouse. By default, both open the new Start Menu and holding down the Shift key when doing either brings up the Start screen. This is customisable so you can have things the other way around if you so desire. Another setting is to switch from the Start screen to the desktop after you log into Windows 8 (you may also have it log in for you automatically but it’s something that I believe anyone should be doing). The Start screen does flash up but things move along quickly; maybe having not appear at all would be better for many.

Classic Shell is free of charge and worked well for me apart from that small rough edge noted above. It also is open source and looks well maintained too. For that reason, it appeals to me more that Stardock’s Start8 (currently in beta release at the time of writing) or Pokki for Windows 8, which really is an App Store that adds a Start Menu. If you encounter Windows 8 on a new computer, then they might be worth trying should you want a Start Menu back. Being an open-minded type, I could get along with the standard Windows 8 interface but it’s always good to have choices too. Most of us want to own our computing experience, it seems, so these tools could have their uses for Windows 8 users.

ASCII Codes

24th August 2015

Having found myself looking for this from time to time, here is a table of ASCII characters and their representation in decimal, hexadecimal and octal forms together with the corresponding HTML entities. The first on the list are various non-printing characters and I have found myself using the TAB one in programming quiet often over the years. Currently, only the core ASCII characters appear but those from the extended set may be added later.

DecimalHexadecimalOctalCharacterHTML
00000NUL (null)
11001SOH (start of heading)
22002STX (start of text)
33003ETX (end of text)
44004ETX (end of transmission)
55005ENQ (enquiry)
66006ACK (acknowledge)
77007BEL (bell)
88010BS (backspace)
99011TAB (horizontal tab)
10A012LF (NL line feed, newline)
11B013VT (vertical tab)
12C014FF (NP form feed, new page)
13D015CR (carriage return)
14E016SO (shift out)
15F017SI (shift in)
1610020DLE (data link escape)
1711021DC1 (device control 1)
1812022DC2 (device control 2)
1913023DC3 (device control 3)
2014024DC4 (device control 4)
2115025NAK (negative acknowledge)
2216026SYN (synchronous idle)
2317027ETB (end of transmission block)
2418030CAN (cancel)
2519031EM (end of medium)
261A032SUB (substitution)
271B033ESC (escape)
281C034FS (file separator)
291D035GS (group separator)
301E036RS (record separator)
311F037US (unit separator)
3220040space 
3321041!!
3422042"
3523043##
3624044$$
3725045%%
3826046&&
3927047'
4028050((
4129051))
422A052**
432B053++
442C054,,
452D055---
462E056..
472F057//
483006000
493106111
503206222
513306333
523406444
533506555
543606666
553706777
563807088
573907199
583A072::
593B073;&#59;
603C074<&#60;
613D075=&#61;
623E076>&#62;
633F077?&#63;
6440100@&#64;
6541101A&#65;
6642102B&#66;
6743103C&#67;
6844104D&#68;
6945105E&#69;
7046106F&#70;
7147107G&#71;
7248110H&#72;
7349111I&#73;
744A112J&#74;
754B113K&#75;
764C114L&#76;
774D115M&#77;
784E116N&#78;
794F117O&#79;
8050120P&#80;
8151121Q&#81;
8252122R&#82;
8353123S&#83;
8454124T&#84;
8555125U&#85;
8656126V&#86;
8757127W&#87;
8858130X&#88;
8959131Y&#89;
905A132Z&#90;
915B133[&#91;
925C134\&#92;
935D135]&#93;
945E136^&#94;
955F137 _&#95;
9660140`&#96;
9761141a&#97;
9862142b&#98;
9963143c&#99;
10064144d&#100;
10165145e&#101;
10266146f&#102;
10367147g&#103;
10468150h&#104;
10569151i&#105;
1066A152j&#106;
1076B153k&#107;
1086C154l&#108;
1096D155m&#109;
1106E156n&#110;
1116F157o&#111;
11270160p&#112;
11371161q&#113;
11472162r&#114;
11573163s&#115;
11674164t&#116;
11775165u&#117;
11876166v&#118;
11977167w&#119;
12078170x&#120;
12179171y&#121;
1227A172z&#122;
1237B173{&#123;
1247C174|&#124;
1257D175}&#125;
1267E176~&#126;
1277F177DEL&#127;

HennessyBlog theme update

12th February 2007

Over the weekend, I have been updating the theme on my other blog, HennessyBlog. It has been a task that projected me onto a learning curve with the WordPress 2.1 codebase. I have collected what I encountered so I know that it’s out there on the web for you (and I) to use and peruse. It took some digging to get to know some of what you find below. Any function used to power WordPress takes some finding so I need to find one place on the web where the code for WordPress is fully documented. The sites presenting tutorials on how to use WordPress are more often than not geared towards the non-techie rather than code cutters like myself. Then again, they might be waiting for someone to do it for them…

The changes made are as follows:

Tweaks to the interface

These are subtle with the addition of navigation controls to the sidebar and the change in location of the post metadata being the most obvious enhancements. “Decoration” with solid and dashed lines (using CSS border attributes rather than the deprecated hr tagset) and standards compliance links.

Standards compliance

Adding standards compliance links does mean that you’d better check that all is in order; it was then that I discovered that there was work to be done. There is an issue with the WordPress wpautop function (it lives in the formatting.php file) in that it sometimes doesn’t add closing tags. Finding out that it was this function that is implicated took a trip to the WordPress.org website; a good rummage in the wp-includes folder does a lot but it can’t achieve everything.

Like a lot of things in the WordPress code, the wpautop function isn’t half buried. The the_content function (see template-functions-post.php) used to output blog entries calls get_content function (also in template-functions-post.php) to extract the data from mySQL. The add_filter function (in plugin.php) associates the wpautop function and others with get_the_content function and the p tags get added to the output.

To return to the non-ideal behaviour that caused me to start out on the above quest, an example is where you have an img tag enclosed by div tags. The required substitution involves the use of regular expressions that work most of the time but get confused here. So adding a hack to the wpautop function was needed to change the code so that the p end tag got inserted. I’ll be keeping an eye out for any more scenarios like this that slip through the net and for any side effects. Otherwise, compliance is just making sure that all those img tags have their alt attributes completed.

Tweaks to navigation code

Most of my time has been spent on tweaking of the PHP code supporting the navigation. Different functions were being called in different places and I wanted to harmonise things. To do this, I created new functions in the functions.php for my theme and needed to resolve a number of issues along the way. Not least among these were regular expressions used for subsetting with the preg_match match that weren’t to my eyes Perl-compliant, as would be implied by the choice of function. I have since found that PCRE’s in PHP use a more pragmatic syntax but there remained issues with the expressions that were being used. They seemed to behave OK in their native environment but fell out of favour within the environs of my theme. Being acquainted with Perl, I went for a more familiar expression style and the issue has been resolved.

Along the way, I broke the RSS feed. This was on my off-line test blog so no one, apart from myself, that is, would have noticed. After a bit of searching, I realised that some stray white-space from the end of a PHP file (wp-config.php being a favourite culprit), after the PHP end tag in the script file as it happens, was finding its way into the feed and causing things to fall over. Feed readers don’t take too kindly to the idea of the XML declaration not making an appearance on the first line of the file. The refusal of Firefox to refresh things as it should caused some confusion until I realised that a forced refresh of the feed display was needed -- sometimes, it takes a while for an addled brain to think of these kinds of things.

All that was needed was a trip to a local shop

5th March 2011

In the end, I did take the plunge and acquired a Sigma 50-200 mm f4-5.6 DC OS HSM lens to fit my ever faithful Pentax K10D. After surveying a few online retailers, I plumped for Park Cameras where the total cost, including delivery, came to something to around £125. This was around £50 less than what others were quoting for the same lens with delivery costs yet to be added. Though the price was good at Park Cameras, I was wondering still about how they could manage to do that sort of deal when others don’t. Interestingly, it appears that the original price of the lens was around £300 but that may have been at launch and prices do seem to tumble after that point in the life of many products of an electrical or electronic nature.

All that was needed was a trip to a local shopUnlike the last lens that I bought from them around two years ago, delivery of this item was a prompt affair with dispatch coming the day after my order and delivery on the morning after that. All in all, that’s the kind of service that I like to get. On opening the box, I was surprised to find that the lens came with a hood but without a cap. However, that was dislodged slightly from my mind when I remembered that I neglected to order a UV or skylight filter to screw into the 55 mm front of it. In the event, it was the lack of a lens cap needed sorting more than the lack of a filter. The result was that I popped in the local branch of Wildings where I found the requisite lens cap for £3.99 and asked about a filter while I was at it. Much to my satisfaction, there was a UV filter that matched my needs in stock though it was that cheap at £18.99 and was made by a company of which I hadn’t heard before, Massa. This was another example of good service when the shop attendant juggled two customers, a gentleman looking at buying a DSLR and myself. While I would not have wanted to disturb another sales interaction, I suppose that my wanting to complete a relatively quick purchase was what got me the attention while the other customer was left to look over a camera, something that I am sure he would have wanted to do anyway. After all, who wouldn’t?

With the extras acquired, I attached them to the front of the lens and carried out a short test (with the cap removed, of course). When it was pointed at an easy subject, the autofocus worked quickly and quietly. A misty hillside had the lens hunting so much that turning to manual focussing was needed a few times to work around something understandable. Like the 18-125 mm Sigma lens that I already had, the manual focussing ring is generously proportioned with a hyperfocal scale on it though some might think the action a little loose. In my experience though, it seems no worse than the 18-125 mm so I can live with it. Both lenses share something else in common in the form of the zoom lens having a stiffer action than the focus ring. However, the zoom lock of the 18-125 mm is replaced by an OS (Optical Stabilisation) one on the 50-200 mm and the latter has no macro facility either, another feature of the shorter lens though it remains one that I cannot ever remember using. In summary, first impressions are good but I plan to continue appraising it. Maybe an outing somewhere tomorrow might offer a good opportunity for using it a little more to get more of a feeling for its performance.

Adobe CS3 Launch

28th March 2007

Last night, I sat through part of Adobe’s CS3 launch and must admit that I came away intrigued. Products from the Macromedia stable have been very much brought under the Adobe umbrella and progressed to boot. One of these that attracts my interest in Dreamweaver and Adobe is promoting its AJAX capabilities (using the Spry library), its browser compatibility checking facility and integration with Photoshop, among other things. Dreamweaver’s CSS support also gets taken forward. In addition, Dreamweaver can now integrate with Adobe Bridge and Adobe Device Central. The latter allows you to preview how your site might look on a plethora of WAP-enabled mobile phones while the latter, unless I have been missing something, seems to have become a media manager supporting all of CS3 and not just Photoshop.

Speaking of Photoshop, this now gets such new features as smart filters, I think of these as adjustment layers for things like sharpening, monochrome conversion and much more. Raw image processing now has a non-destructive element and Photoshop Lightroom is being touted as a companion for the main Photoshop. Speaking of new additions to the Photoshop family, there is a new Extended edition for those working with digital imaging with a 3D aspect and this is targeted at scientists, engineers, medical professionals and others. It seems that data analysis and interpretation is becoming part of the Photoshop remit now as well.

Dreamweaver and Photoshop are the components of the suite in which I have most interest but I also note that Contribute now has blogging capabilities; it would be interesting to see how these work, especially given Word 2007’s support for blogging tools like WordPress and Blogger. Another member of note is Version Cue, adding version control to the mix and making CS3 more like a group of platforms than collections of applications.

Unsurprisingly, the changes are rung out for the rest of the suite with integration being a major theme and this very much encompasses Flash too. The sight of an image selection being copied straight into Dreamweaver was wondrous in its own way and rendering of Photoshop files into 3D images was also something to behold. The latter was used to demonstrate the optimisations that have been added for the Mac platform, a major selling point apparently.

I suppose that the outstanding question is this: do I buy into all of this? It’s a good question because the computer enthusiast seems to be getting something of a sidelining lately. And that seems to the impression left by Windows Vista in its giving the appearance that Microsoft is trying to be system administrator to the world. There is no doubt but CS3 is very grown up now and centred around work flows and processes. These have always been professional tools and the present level of sophistication and pricing* very much reflects this. That said, enthusiasts like me have been known to use them too, at least for learning purposes. The latter point may yet cause me to get my hands on Photoshop CS3 with its powerful tools for digital imaging but Dreamweaver is another story. It doesn’t fit what how I work now so this is an upgrade that I may give a miss, as impressive as it looks. For a learning experience, I might download a demo but that would a separate matter from updating my web presence. This time next month may tell a tale…

*Pricing remains the bugbear for the U.K. market that it always has been. At the present exchange rates, we should be getting a much better deal on Adobe products that we do. For instance, Amazon.com has the Web Premium CS3 suite from Macromedia Studio 8 priced at $493.99 while it is £513.99 on Amazon.co.uk. Using the exchange rate current as I write this, £1 buying $1.96605, the U.K. price is a whopping $1010.53 in U.S. terms. To me, this looks like price gouging and Microsoft has been slated for this too. I wonder what will be said to Adobe on this one.

  • All the views that you find expressed on here in postings and articles are mine alone and not those of any organisation with which I have any association, through work or otherwise. As regards editorial policy, whatever appears here is entirely of my own choice and not that of any other person or organisation.

  • Please note that everything you find here is copyrighted material. The content may be available to read without charge and without advertising but it is not to be reproduced without attribution. As it happens, a number of the images are sourced from stock libraries like iStockPhoto so they certainly are not for abstraction.

  • With regards to any comments left on the site, I expect them to be civil in tone of voice and reserve the right to reject any that are either inappropriate or irrelevant. Comment review is subject to automated processing as well as manual inspection but whatever is said is the sole responsibility of the individual contributor.